<?php
use yii\helpers\Html;
use yii\helpers\Url;
use \yii\widgets\ActiveForm;
//use yii\bootstrap\ActiveForm;
?>
<style>
@media only screen and (max-width: 329px){
    #work .weui_media_info_meta {
        font-size: 12px !important;
    }
}
#work .scr-page .weui_media_box .weui_media_box::before {
  border-top:0px !important;
}
#work .scr-page .weui_media_box .weui_media_box {
  padding-top:5px !important;
  padding-bottom:0px !important;
}
#work .weui_media_info_meta{
 font-size: 14px;
}
#work .weui_media_box.weui_media_text .weui_media_info{
  margin-top: 10px;
  color: #999999;
  line-height: 14px;
}
#work .weui_info_box{
  background-color: rgb(247, 247, 247);
  padding-top: 8px;
  padding-bottom: 5px;
  margin-left: -8px;
  padding-left: 8px;
}
#work .weui_info_box .weui_media_title{
  font-size: 16px;
  color: #353535;
}
#work .weui_info_time{
  color:#cccccc;
  font-size: 12px;
  height:20px;
  line-height:20px;
}
#work .weui_media_text .weui_media_title .name{
  color:#576b95 !important;
}
#work .weui_media_text .weui_media_title .info{
  font-size:13px;
}
#work  .weui_media_box .weui_media_text .weui_media_info{
	padding: 0px !important;
  }
#work  .weui_media_box.weui_media_text .weui_media_info_meta{
	padding: 0px  !important;
  }
 #work .weui_media_info .weui_media_info_meta{
	text-align: center;
    width: 30%;
  }
 #work .weui_media_appmsg .weui_media_box {
    padding: 10px 0px 10px 5px !important;
  }
 #work .weui_media_box {
    padding: 10px 5px 5px 5px !important;
  }
  #work .weui_media_info .weui_media_info_meta:first-child{
	text-align: left;
  }

ul.pagination {margin: 10px; padding: 10; list-style-type: none; text-align: center; }
ul.pagination li {display: inline; margin: 0 30px;}
ul.pagination li.disabled {display: none;}
ul.pagination li a {text-decoration: none;color: #999999 !important;margin: 0 10px;padding: 0 10px;}

</style>

<?php //yii\widgets\Pjax::begin(); ?>

<header class="scr-header po-f">
	<div class="itms itms2" id="hz-btn"><span style="padding-right: 10px;">合作</span></div>
	<div class="itms itms2" id="zp-btn"><span style="padding-right: 10px;">招聘</span></div>
</header>

<script type="text/javascript">

function gotoProfile(id) {
    window.location.href = "<?php echo Url::to(['market-profile']); ?>&id=" + id;
}

function gotoWorkDetail(id)
{
	//window.location.href="work/detail.jsp";
    window.location.href = "<?php echo Url::to(['work-detail']); ?>&id=" + id;
}

$(function()
{
    $("#hz-btn").swipe({
        tap: function () {
            $('#post_type').val(<?= \common\models\MktPost::POST_TYPE_COOPERATION ?>);
            $( "#shadow_form").submit();
        }
    });
    
    $("#zp-btn").swipe({
        tap: function () {
            $('#post_type').val(<?= \common\models\MktPost::POST_TYPE_JOB ?>);
            $( "#shadow_form").submit();
        }
    });

    $("#work").swipe({
        swipeUp:function(){
            var ch = $("#work").height();
            var wh = $('body').height();
            var top = $("#work").parent().scrollTop();
            var hh = ch - wh;
            if(top >= hh)
            {
                frmwebm.toast("数据加载中...", 100);
                $('input[name=page]').val( parseInt($('input[name=page]').val()) + 1 );
                $("#shadow_form").submit();
            }
        },

        swipeDown:function(){
            var top = $("#work").scrollTop();
            if(top <= 0)
            {
                frmwebm.toast("数据加载中...", 100);
                $('input[name=page]').val( parseInt($('input[name=page]').val()) - 1 );
                $("#shadow_form").submit();
            }
        }

    });

//    event.preventDefault();
//  $('html, body').animate({ scrollTop: 0 }, 500);
})
</script>


<!--主体-->
<section class="page scr-page">
	<div class="weui_panel weui_panel_access">

		<div id='mylist' class="weui_panel_bd">
                <?php echo yii\widgets\ListView::widget([
                    'dataProvider' => $dataProvider,
                    'itemView' => '_item',
                    //'layout' => "{items}\n{pager}\n",
                    'layout' => YII_ENV_DEV ? "{items}\n{pager}\n" : "{items}\n",
                    'pager' => [
                        'firstPageLabel' => false,
                        'lastPageLabel' => false,
                        'prevPageLabel' => '上页',
                        'nextPageLabel' => '下页',
                        'maxButtonCount' => 0,
                    ],

                ]) ?>
		</div>

        <div class="hide">
            <?php $form = ActiveForm::begin(['method' => 'get', 'id'=>'shadow_form', 'options'=>['data-pjax' => true], ]); ?>
            <?php if (!isset($_GET['page'])): ?>
                <input type="hidden" name="page" value="1">
            <?php endif; ?>
            <?= $form->field($searchModel, 'post_type') -> textInput(['id' => 'post_type']) ?>
            <?php ActiveForm::end(); ?>
        </div>

	</div>
</section>
<?php //yii\widgets\Pjax::end(); ?>


<!--
<script type="text/javascript">
function gotoWorkDetail(object)
{
	window.location.href="work/detail.jsp";
}
function gotoManDetail(object)
{
	window.location.href="market/woman.jsp";
}
</script>
-->
<?php
/*

    $(".weui_media_title, .weui_media_hd").swipe({
        tap: function () {
            window.location.href = "<?php echo Url::to(['wap/market-woman',]); ?>";
        }
    });

    $(".weui_info_box").swipe({
        tap: function () {
            window.location.href = "<?php echo Url::to(['wap/work-detail',]); ?>";
        }
    });


<?php if (empty(Yii::$app->request->getQueryParam('page'))): ?>
<?php echo Html::textInput('page', '1', ['name'=>'page']); ?>
<?php endif; ?>

<div class="hidex">
    <?php $form = \yii\widgets\ActiveForm::begin(['method' => 'get', 'id'=>'shadow_form']); ?>
    <?= $form->field($searchModel, 'post_type') -> textInput(['id' => 'post_type']) ?>
    <?php echo Html::textInput($dataProvider->pagination->pageParam, $dataProvider->pagination->getPage() + 1, ['name'=>'page']); ?>
    <?php \yii\widgets\ActiveForm::end(); ?>
</div>


*/
